furny.ga.operators
Class RealMutationOp

java.lang.Object
  extended by ga.core.goperators.ProbabilityOp
      extended by furny.ga.operators.RealMutationOp
All Implemented Interfaces:
IGeneticOp, IMutationOp<FurnLayoutIndividual>

public class RealMutationOp
extends ProbabilityOp
implements IMutationOp<FurnLayoutIndividual>

The real mutation operator mutates genes randomly. Every single gene has a mutation chance given by the mutation probability.

Since:
12.08.2012
Author:
Stephan Dreyer

Field Summary
private  int pNewFurniture
           
private  int pRemoveFurniture
           
private  int wID
           
private  int wRotate
           
private  int wTranslate
           
 
Constructor Summary
RealMutationOp(int pMutate)
          Creates the operator with the given mutation probability.
RealMutationOp(int pMutate, int pNewFurniture, int pRemoveFurniture)
          Creates the operator with the given mutation probability and given probabilities to add or remove furniture segments.
RealMutationOp(int pMutate, int wID, int wTranslate, int wRotate, int pNewFurniture, int pRemoveFurniture)
          Creates the operator with the given mutation probability and given probabilities to add or remove furniture segments.
 
Method Summary
static void main(java.lang.String[] args)
          Main method for testing.
 FurnLayoutIndividual mutate(FurnLayoutIndividual individual, GAContext context)
          Performs a mutation (if probability met) of the given individual and returns the new individual.
 
Methods inherited from class ga.core.goperators.ProbabilityOp
doOperate, doOperate, getRandom
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pNewFurniture

private final int pNewFurniture

pRemoveFurniture

private final int pRemoveFurniture

wID

private int wID

wTranslate

private int wTranslate

wRotate

private int wRotate
Constructor Detail

RealMutationOp

public RealMutationOp(int pMutate,
                      int wID,
                      int wTranslate,
                      int wRotate,
                      int pNewFurniture,
                      int pRemoveFurniture)
Creates the operator with the given mutation probability and given probabilities to add or remove furniture segments. The widths are also defined.

Parameters:
pMutate - Mutation probability.
wID - ID mutation width.
wTranslate - Translation mutation width.
wRotate - Rotation mutation width.
pNewFurniture - Probability to add a furniture segment.
pRemoveFurniture - Probability to remove a furniture segment.
Since:
12.08.2012

RealMutationOp

public RealMutationOp(int pMutate,
                      int pNewFurniture,
                      int pRemoveFurniture)
Creates the operator with the given mutation probability and given probabilities to add or remove furniture segments.

Parameters:
pMutate - Mutation probability.
pNewFurniture - Probability to add a furniture segment.
pRemoveFurniture - Probability to remove a furniture segment.
Since:
12.08.2012

RealMutationOp

public RealMutationOp(int pMutate)
Creates the operator with the given mutation probability.

Parameters:
pMutate - Mutation probability.
Since:
12.08.2012
Method Detail

mutate

public FurnLayoutIndividual mutate(FurnLayoutIndividual individual,
                                   GAContext context)
Description copied from interface: IMutationOp
Performs a mutation (if probability met) of the given individual and returns the new individual.

Specified by:
mutate in interface IMutationOp<FurnLayoutIndividual>
Parameters:
individual - Individual to mutate.
context - The GA context.
Returns:
Mutated individual.

main

public static void main(java.lang.String[] args)
Main method for testing.

Parameters:
args - No arguments required.
Since:
12.08.2012